<?php
namespace Admin\Controller;
use Think\Controller;
class BalanceController extends CommonController{
    public function index(){
        $this->info=M('balance_user a')
            ->join("left join agency_user_list b on a.user_id=b.user_id")
            ->field("a.*,b.name")
            ->select();

        $this->display();
    }
        public function edit(){
    		$id=I("get.id");
            $data['state']=1;
            if( M('balance_user')->where(array("balance_id"=>$id))->save($data) ){
                $this->success("恢复成功","",1);die;
            
            }else{
                $this->error("恢复失败","",1);die;
            }
        }

		public function del(){
			$id=I("get.id");
        	$data['state']=0;
        	if(M('balance_user')->where(array("balance_id"=>$id))->save($data)){
            $this->success("删除成功","",1);die;
        }else{
            $this->error("删除失败","",1);die;
        }
		    }

    }